/*
 * Projet Java / UML -- Trombinoscope - Février / Avril 2012
 * Virginie Messe -- William Huber
 */
package dbtest;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

import mvc_model.*;
import outils.PersonneDAO;
import outils.PromotionDAO;

/**
 *
 * @author Virginie Messe & William Huber
 */
public class GetPersonnesByPromotionTest1 {
    private PersonneDAO persDAOT;
    private PromotionDAO promDAOT;
    
    @Test
    public void fGPBP1_1() throws ClassNotFoundException {
        Class.forName("com.mysql.jdbc.Driver");
        Personne perso = new Personne();
        ArrayList resAL_1 = new ArrayList<Personne>();
        
        
        resAL_1 = perso.getPersonnesByPromotion(1);
        Iterator<Personne> iter = resAL_1.iterator();
        
        while (iter.hasNext()) {
            Personne perso_une = iter.next();
            System.out.println("fGPBP1_1 : " + perso_une.getPrenom() 
                    + " " + perso_une.getNom() 
                    + " " + perso_une.getPromotion().getClasse()
                    + " " + perso_une.getPromotion().getAnneeScolaire());
        }
        
        
    }
    
    @Test
    public void fGPBP1_2() throws ClassNotFoundException {
        Class.forName("com.mysql.jdbc.Driver");
        Personne perso = new Personne();
        ArrayList resAL_2 = new ArrayList<Personne>();
        
        
        resAL_2 = perso.getPersonnesByPromotion(2);
        Iterator<Personne> iter = resAL_2.iterator();
        
        while (iter.hasNext()) {
            Personne perso_une = iter.next();
            System.out.println("fGPBP1_2 : " + perso_une.getPrenom() 
                    + " " + perso_une.getNom() 
                    + " " + perso_une.getPromotion().getClasse()
                    + " " + perso_une.getPromotion().getAnneeScolaire());
        }
        
        
    }
}
